/* mfworlc.i - RELEASE WORK ORDERS Copy routing to operations (wr_route)      */
/* Copyright 1986-2011 QAD Inc., Santa Barbara, CA, USA.                      */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Id:: mfworlc.i 2301 2010-11-08 07:09:06Z jvz                           $: */
/* $Revision: 1.14 $                                                      */
/* REVISION: 1.0      LAST MODIFIED: 06/19/86   BY: EMB                       */
/* REVISION: 2.1      LAST MODIFIED: 10/14/86   BY: EMB                       */
/* REVISION: 4.0      LAST MODIFIED: 02/17/88   BY: RL  *A171*                */
/* REVISION: 4.0      LAST MODIFIED: 03/21/88   BY: WUG *A194*                */
/* REVISION: 5.0      LAST MODIFIED: 07/19/89   BY: emb *B169*                */
/* REVISION: 6.0      LAST MODIFIED: 06/20/90   BY: emb *D001*                */
/* REVISION: 7.3      LAST MODIFIED: 11/06/92   BY: emb *G689*                */
/* REVISION: 7.3      LAST MODIFIED: 08/22/94   BY: WUG *GN76*                */
/* REVISION: 8.6      LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 11/17/99   BY: *N04H* Vivek Gogte        */
/* REVISION: 9.1      LAST MODIFIED: 09/05/00   BY: *N0RF* Mark Brown         */
/* REVISION: 9.1      LAST MODIFIED: 10/10/00   BY: *N0H2* Vivek Gogte        */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* Revision: 1.10  BY: Katie Hilbert DATE: 04/01/01 ECO: *P008* */
/* Revision: 1.12  BY: Paul Donnelly (SB) DATE: 06/28/03 ECO: *Q00G* */
/* $Revision: 1.14 $    BY: Ellen Borden   DATE: 12/06/05 ECO: *R000*   */

/*V8:ConvertMode=NoConvert                                                    */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* {1} routing code    {2} order number         {3} order qty */
/* {4} effective date  {5} lot number           {6} part number */

for each ro_det  where ro_det.ro_domain = global_domain and  ro_routing = {1}
   no-lock:
   if (ro_start = ? or ro_start <= {4})
      and (ro_end = ? or ro_end >= {4})
   then do:
      find wr_route  where wr_route.wr_domain = global_domain and  wr_lot = {5}
         and wr_op = ro_op no-error.
      if not available wr_route then
   do:
         create wr_route.
         wr_route.wr_domain = global_domain.
      end.
      assign
         wr_nbr = {2}
         wr_lot = {5}
         wr_part = {6}
         wr_op = ro_op
         wr_std_op = ro_std_op
         wr_desc = ro_desc
         wr_wkctr = ro_wkctr
         wr_mch = ro_mch
         wr_setup = ro_setup
         wr_run = ro_run
         wr_move = ro_move
         wr_qty_ord = {3}
         wr_tool = ro_tool
         wr_vend = ro_vend.

      assign
         wr_yield_pct = ro_yield
         wr_setup_men = ro_setup_men
         wr_men_mch   = ro_men_mch
         wr_tran_qty  = ro_tran_qty
         wr_mch_op    = ro_mch_op
         wr_queue     = ro_queue
         wr_wait      = ro_wait
         wr_milestone = ro_milestone
         wr_sub_cost  = ro_sub_cost

         wr_sub_lead  = ro_sub_lead.

   end.
end.
